COPY
COPY_O
 
Syntax: COPY file1 TO file2
    or: COPY [file] [TO file2]    (Toolkit II)
    or: COPY file1 [,file2 [,file3...]] {TO | !} fileb  (THOR XVI)
   and: COPY_O [file] [TO file2]    (Toolkit II)
    or: COPY_O file1 [,file2 {,file3} ] {TO | !} fileb  (THOR XVI)
Location: QL ROM, Toolkit II, THOR XVI

The command COPY duplicates file1, so that file2 is an exact copy. The parameters can also be a device (eg. ser1, con, scr,  scr_400x20) or, if you have Toolkit II installed, a channel (eg. #3) can be used for the second parameter.

If Toolkit II is present, COPY supports the default devices and sub-directories. COPY will look for the file to be copied on the default data device if necessary (see DATAD$).

EXAMPLE:
COPY ram1_prog_bas TO #2  Copy ram1_prog_bas to a channel

NOTE:
Each file includes a file header of 64 bytes to store supple-mentary information such as the time of the last update, file type, length and much more. Without Toolkit II, COPY will always copy the header if a file is copied. The Toolkit II COPY command does not copy the header to serial devices (eg. ser) if this is specified as the destination.

THOR XVI NOTES:
The THOR XVI (v6.41 and later) supports the third variant of COPY. This allows you to merge several files:

COPY flp1_texta,flp1_textb TO flp2_Book

will create a new file flp2_Book made up of the merged files flp1_texta and flp1_textb. The headers will (of course) not be copied.

If you alter the TO deliminator to !, ie.

COPY flp1_texta,flp1_textb ! flp2_Book

then it is assumed that fileb already exists and file1, file2 and file3 are all appended to it.

Note:
COPY_O is the same as COPY except that it will forcibly overwrite an existing file.

CROSS-REFERENCE:
SPL_USE and DEST_USE set the destination device.
See COPY_N and COPY_H for copying file headers.
SPL performs a background copy (ie. it multitasks).
See APPEND which is similar to the THOR variant.
